import { _decorator, Component, Node, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('RotateCube')
export class RotateCube extends Component {
    // 旋转速度（角度/秒）
    @property({ type: Number })
    rotateSpeed: number = 90;

    update(deltaTime: number) {
        // 计算每帧旋转的角度（基于时间差）
        const eulerAngles =this.node.eulerAngles;
        this.node.eulerAngles = new Vec3(eulerAngles.x,eulerAngles.y+this.rotateSpeed *deltaTime,eulerAngles.z)
    }
}


